UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y7sS55s9PiE09Y9YeHq+2Q1uXcj3NxKEZCAgU6PuEyo=' 
WHERE 
  key_id = '677c5a23ca8cd97ccbd55ffd248861aa308e4880e6d4e97ef945960cbe4aaddc' 
  AND (
    token = 'Y7sS55s9PiE09Y9YeHq+2Q1uXcj3NxKEZCAgU6PuEyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032