UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LJgDgHceN7YgDoq6tNtLh6EhVotd393lnYbp3CuGPRY=' 
WHERE 
  key_id = '56d06a35d0a5e89a532753bee8a18bd4fdbf57b8fe3a6bec13af32c8bbedfc9d' 
  AND (
    token = 'LJgDgHceN7YgDoq6tNtLh6EhVotd393lnYbp3CuGPRY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026