UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pkxN/Ocsy9KsoNaoTyyo6zjwlLEZWWGzvpwUJFe9PqI=' 
WHERE 
  key_id = '27cd74e5dd46e34d8531c9c0ad3f5dd16a27894f75e3a8076482e5cdc3e694c4' 
  AND (
    token = 'pkxN/Ocsy9KsoNaoTyyo6zjwlLEZWWGzvpwUJFe9PqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049