UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sWLpzWJO2GEAxyky/LqCnZiKuQGhMMshnqWCHO/uNvw=' 
WHERE 
  key_id = '2563f608d136cc21922ea65080a42ac6e6fb201f98c95c728130aeea9caddeaf' 
  AND (
    token = 'sWLpzWJO2GEAxyky/LqCnZiKuQGhMMshnqWCHO/uNvw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049