UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vCG+djocH3Enz4NaNaMOoyobMZSFoiBvzxAkESsvzPQ='
WHERE
key_id = '86cf64e7a5337a296459a3d009bd2109d6a4fa3643cb6e444f81a9b62568eee7'
AND (
token = 'vCG+djocH3Enz4NaNaMOoyobMZSFoiBvzxAkESsvzPQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)