UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+sW/6tHhQNYDpStX5gx7V+6+cGVYDbgMS0Mk56nY+OQ='
WHERE
key_id = 'a6731a0ee06b5128bd11c8932055c532afea6abea575615778b182ede2745d96'
AND (
token = '+sW/6tHhQNYDpStX5gx7V+6+cGVYDbgMS0Mk56nY+OQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)