UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jqSTvSWwuOaiEjGu/SsippPBYB53j6ORr5+Hg8ySPTw=' 
WHERE 
  key_id = '91555047e76ca9c659339f236f877e1cfd68dd27e6d30204bd1bc594a528d412' 
  AND (
    token = 'jqSTvSWwuOaiEjGu/SsippPBYB53j6ORr5+Hg8ySPTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042