UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MUcOzR4DDfWqY6nzftKgAswIb0XGu5jgRY+rP01eLBU=' 
WHERE 
  key_id = '33949197310c10d6ce93211c5a30c35410d13ae150f1f89f874b01b22b1c8a78' 
  AND (
    token = 'MUcOzR4DDfWqY6nzftKgAswIb0XGu5jgRY+rP01eLBU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023