UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YDDkyh/GFEXkuhfqxQViImcWENYrskdU+e5dA1fd8yA='
WHERE
key_id = '45981243686a3dd55bbf49af2a70c9d2e2e0456926d2206895c94cc0226dde82'
AND (
token = 'YDDkyh/GFEXkuhfqxQViImcWENYrskdU+e5dA1fd8yA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)