UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3ikp26jRUXlx+QR3JZYYm7HJR0saZi2aSmLAjjv4nKw='
WHERE
key_id = 'b393647a83c0aba4a8fefd2e6c67e15b2a17253f050b284a0f61b285e554a2fc'
AND (
token = '3ikp26jRUXlx+QR3JZYYm7HJR0saZi2aSmLAjjv4nKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)