UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4BOs8KUx6qpcmXZLz/lZqsCFUei3gFmv+NnfBgJrQiM='
WHERE
key_id = '6e8e1f55010559d4d6f32a6f80f06603c4e5d26e0bc4d078bdd66a8f7e463c51'
AND (
token = '4BOs8KUx6qpcmXZLz/lZqsCFUei3gFmv+NnfBgJrQiM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)