UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vynjNlyB1Igy6rS4i6FhGq8QK757DXIUJ1kc+Zllj8U='
WHERE
key_id = '58d02fb14d7fb9be6665a2c856f02e3f63717fa6753ee79506afa9c24d8bdc84'
AND (
token = 'vynjNlyB1Igy6rS4i6FhGq8QK757DXIUJ1kc+Zllj8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)