UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3onpFT87lCvor/YunsU45GYMHFb87S5sK3zQQNhBOUs='
WHERE
key_id = '0a70d880e5b92cd96455849f35aa7914c1005bb75beb7ee7f8b870255919de6c'
AND (
token = '3onpFT87lCvor/YunsU45GYMHFb87S5sK3zQQNhBOUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)