UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bI7eXMOgtm7w87EQ4dHNl0LmQIG26Fvqqanfi+FdlW4=' 
WHERE 
  key_id = 'a32f0b52710d560da710db6d4d7adbef83d495a0fc002a8be42ca7fead635ac6' 
  AND (
    token = 'bI7eXMOgtm7w87EQ4dHNl0LmQIG26Fvqqanfi+FdlW4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030