UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G0bbeORjDIUTo26IXEpB8p0NJl6XX/vXkCgzZYDHmjc='
WHERE
key_id = '7b72b6664cb94b18c2f1a70290b0944109f5a9b445268ebe2e0180e1aa519c45'
AND (
token = 'G0bbeORjDIUTo26IXEpB8p0NJl6XX/vXkCgzZYDHmjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)