UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lZK/8jKvEC3rFVIx+4IfY7vh49u8olziXqtKuhfxEPQ='
WHERE
key_id = '5a6dd9f7b269a040bb0d81f4f208e335d6334d25492a3b79f08971473bc4f899'
AND (
token = 'lZK/8jKvEC3rFVIx+4IfY7vh49u8olziXqtKuhfxEPQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)