UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kFcqFI33Qs6xlZHCaH/wEfJwaoZg1TGsdD7CZH8Js0='
WHERE
key_id = 'd2e65d65618a2fb33e500afdbb0eca803ed3fb8a8dbe83faab7c7bfeabac8793'
AND (
token = '0kFcqFI33Qs6xlZHCaH/wEfJwaoZg1TGsdD7CZH8Js0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)