UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GDK8/yz0G7Pt/HkxjnM/KZBcftCC9Xv/5M7Eyfsvg/Q=' 
WHERE 
  key_id = '3cbfd20052009229b82ffea7f796e479ca5e8b9cf44278498105138b08f5a6fe' 
  AND (
    token = 'GDK8/yz0G7Pt/HkxjnM/KZBcftCC9Xv/5M7Eyfsvg/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019