UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cZ6zNUx8ZWGE3VfxeqD2CqeeJq49NnhtZPRhdIsgWNQ=' 
WHERE 
  key_id = '4e0a76dfca859707e271fc3bba0461dff2f3de76afffab7ffa8890512215dc09' 
  AND (
    token = 'cZ6zNUx8ZWGE3VfxeqD2CqeeJq49NnhtZPRhdIsgWNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027