UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EdlyPnpVDZABv64nezdIQXcwbBpi6je3CSxhfIgxCiE='
WHERE
key_id = '3027d7ea336158b9e58ff393678cbc84a7af5cdc85276ced6c9cbb6d11dddf34'
AND (
token = 'EdlyPnpVDZABv64nezdIQXcwbBpi6je3CSxhfIgxCiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)