UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0wfRncj5lhALaaqYi9aBLNvScJX6UwrfbiO72Ivj/KM=' 
WHERE 
  key_id = 'd31b7f8b2502a9b3ff842bcda2339fab00f4454b8d6568c383a3b0a3e0ec4fa8' 
  AND (
    token = '0wfRncj5lhALaaqYi9aBLNvScJX6UwrfbiO72Ivj/KM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015