UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CdafqXVVvVJrnHBI7K4NqRhEsCCD9I0D95ubNSaT3UU='
WHERE
key_id = '992ffc7a35c8cbccf021ddec767ad99f0c945836ba57880da58cbacc4336e78b'
AND (
token = 'CdafqXVVvVJrnHBI7K4NqRhEsCCD9I0D95ubNSaT3UU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)