UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vg6XC4NgAQ6U//9s3qs/EEJ7b0yJ3JhXOUOTPDXPvQo='
WHERE
key_id = 'ade6581c4e24d24f5b3003f2d316aa4e7f897be35a60245867c4974b00e7f3ba'
AND (
token = 'vg6XC4NgAQ6U//9s3qs/EEJ7b0yJ3JhXOUOTPDXPvQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)