UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uRayjuMYTHb6ECoTEDb9GwFApJepiV1AX62lSeG/oTk=' 
WHERE 
  key_id = '7f24cc93fea6ee0af82ad8701e3db77cdf6ae15f0f1cf40c81360a51db0217be' 
  AND (
    token = 'uRayjuMYTHb6ECoTEDb9GwFApJepiV1AX62lSeG/oTk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034