UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q44aHfLgFPnd660DOwDygvfkkexApJl7/IgfWqNKmU8=' 
WHERE 
  key_id = '5917339e6ce20ca270fe647158fd590d47a00328a574741aa0eda6b96cfd632b' 
  AND (
    token = 'Q44aHfLgFPnd660DOwDygvfkkexApJl7/IgfWqNKmU8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042