UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kxxIaXAbewcAaOpW9FuBcyBXsukmPwBPgzVoqTqqCNI=' 
WHERE 
  key_id = '2ea05b4965683c8ad276bf80bda0d2b08e90ca40792e19285bc985046b611816' 
  AND (
    token = 'kxxIaXAbewcAaOpW9FuBcyBXsukmPwBPgzVoqTqqCNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032