UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F2Pse3Sb1E14jkiU9fY/Vgmhjm1gY6HWji0OPwVKm/Y=' 
WHERE 
  key_id = '880f861c236cae2088cbb4ad64cd1201d75322d5dd8e7277843eb5da6e4155ac' 
  AND (
    token = 'F2Pse3Sb1E14jkiU9fY/Vgmhjm1gY6HWji0OPwVKm/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038