UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8UQvCi/D+eX7ls6QMw0Ukgm0/5qMHcotNIUBTu+5V5w='
WHERE
key_id = '96afbd7f00ba557d6d181b4e3efd3c6f02a2458c6171d699247c92af6d0d3ef0'
AND (
token = '8UQvCi/D+eX7ls6QMw0Ukgm0/5qMHcotNIUBTu+5V5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)