UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v6YcUUFZPkMVS65ObzBm75DROO3LR4YmRjh/YP9krcw=' 
WHERE 
  key_id = '81133fa10de45080748fe8e874e5437c0b422bb0619f1f3e0df34b4805eb9557' 
  AND (
    token = 'v6YcUUFZPkMVS65ObzBm75DROO3LR4YmRjh/YP9krcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026