UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9dBF9tbGfI4w8qpZTL5m0Ef7UzsJaB2+Q8ENPloFojA=' 
WHERE 
  key_id = 'de737d989afe98a7f6c84456f5662b22554112c1a676128ceb6df0c5cd9db86d' 
  AND (
    token = '9dBF9tbGfI4w8qpZTL5m0Ef7UzsJaB2+Q8ENPloFojA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028