UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kTA+O8sRStf5A6PkEovEFRoQcpVmcGBKqwqA+KfR/i8=' 
WHERE 
  key_id = 'c0c1b7a3092bbb29b05d82e45f0e183a6fd044a0f4d733d1fa81931515bb490a' 
  AND (
    token = 'kTA+O8sRStf5A6PkEovEFRoQcpVmcGBKqwqA+KfR/i8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035