UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mXNK1dXTp5CIkgo/ZqzVipg0NLny/hw51nx6EBon/Eo=' 
WHERE 
  key_id = '75374a7b96cdd2983b17e17d096b377aa584c954ae01932dfc13ba164a39b2c5' 
  AND (
    token = 'mXNK1dXTp5CIkgo/ZqzVipg0NLny/hw51nx6EBon/Eo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049