UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7vWPB4afwa1dQYV2h7AlqJNvAJ4d5Sk03Kg2C4VexJo=' 
WHERE 
  key_id = 'c318791c8b6c79e3b81215743b3d45cbde8a3ff61782eb52e94a6e4b4f13f6ff' 
  AND (
    token = '7vWPB4afwa1dQYV2h7AlqJNvAJ4d5Sk03Kg2C4VexJo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024