UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zkhK5xmC6yP1YJK1nqS7r7/shpTfi0DynrPM8xfOBSs='
WHERE
key_id = '16522b019f4671ad330a4cfda7787c7d2c6c3dd9b0b3aad8089888355affd045'
AND (
token = 'zkhK5xmC6yP1YJK1nqS7r7/shpTfi0DynrPM8xfOBSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)