UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nZAO4Qo2FKjLn8jtzbjDjy+vJjcgFMQRNQgCqkN32NI='
WHERE
key_id = 'c1a3806cef50e0589ca93914cb82d0d38a6d559bb371f7de1cb9837f1ffe4279'
AND (
token = 'nZAO4Qo2FKjLn8jtzbjDjy+vJjcgFMQRNQgCqkN32NI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)