UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EO2At9dKCqGtqshe1q5uJNdnleVCw0uuPf4qog5ujsg='
WHERE
key_id = 'f6d480d8e54dbfb4f00c9f7bd77a6fddf01b06af377054c994279a4e153ad382'
AND (
token = 'EO2At9dKCqGtqshe1q5uJNdnleVCw0uuPf4qog5ujsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)