UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gQZ/3lggtqR0MD7REKiWF7JkdaW9NJPfDkvzunTuwFo=' 
WHERE 
  key_id = '2cef4d1519e0d64a9f6751c60f1213e88d7db8b37c9865347f4360828f63fd44' 
  AND (
    token = 'gQZ/3lggtqR0MD7REKiWF7JkdaW9NJPfDkvzunTuwFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043