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

Query time 0.00019