UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F+vYoNKt3AEPPtdXPzG2FXSjU9Ywk4k/swzlZiWK+ws='
WHERE
key_id = 'cb53db093f80498b45017b30ea4d87279b2748c12f8e1bd01263f395e65a8e50'
AND (
token = 'F+vYoNKt3AEPPtdXPzG2FXSjU9Ywk4k/swzlZiWK+ws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)