UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XAuvkHy/Njsfi5s0v6tdXSblspaMzUGu1h11mzwrI5g='
WHERE
key_id = '96f3bc532e6bb2ebe974a9b3b395d214747bbf8fec5a95bfbe354af8914157f1'
AND (
token = 'XAuvkHy/Njsfi5s0v6tdXSblspaMzUGu1h11mzwrI5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)