UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vxLbYSZ1/OIg2qe73cdcdSSBgayKyMJXhlbzVk+IuKs=' 
WHERE 
  key_id = 'cf7870505b017bacf336587ccf2a3898f6b67d30ac5834a67c369a9923f0f437' 
  AND (
    token = 'vxLbYSZ1/OIg2qe73cdcdSSBgayKyMJXhlbzVk+IuKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029