UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6u2Fz1QC9oekxTpJhkWD3BjkRQR8EuhXVuh5fpXhIWw=' 
WHERE 
  key_id = 'c4db81cb34b9663e3c474fd7119c306c851228af7def9488abdfa34566b0103b' 
  AND (
    token = '6u2Fz1QC9oekxTpJhkWD3BjkRQR8EuhXVuh5fpXhIWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044