UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gh9vky4+/Vj88+FY5h5zvFirW+8X6ckHAOleNg9srFY=' 
WHERE 
  key_id = '274e6a36fb1ddaa37e3ecae87fc469ec9378438598a7df8c1a57b227e2eb43dd' 
  AND (
    token = 'Gh9vky4+/Vj88+FY5h5zvFirW+8X6ckHAOleNg9srFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052