UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'abp1qLpPDsZyYib8FukNhlL99v9vyNyZWXl6iC4i2CY='
WHERE
key_id = 'ee352c0bf3c42d40600cf7ee88315135d55cae9a0c19b22475486db3c3c992a2'
AND (
token = 'abp1qLpPDsZyYib8FukNhlL99v9vyNyZWXl6iC4i2CY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)