UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U/F5G2zP5ZQgbl2WSEZhbxgAMtqZqFRnZ6Qjxs85xDk=' 
WHERE 
  key_id = '0e4930494be71dfca5cea9c81b243a50fd70149c70e7e4b193523f5e2c905a63' 
  AND (
    token = 'U/F5G2zP5ZQgbl2WSEZhbxgAMtqZqFRnZ6Qjxs85xDk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016