UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'roNUitvZB3sxwFiOGA/+YvBZe8SRJl17jcrMzEZtpfc='
WHERE
key_id = 'ba35b94d4fc30223099ffce3112cdc2010c830db80757b057399a03e0a5b78d3'
AND (
token = 'roNUitvZB3sxwFiOGA/+YvBZe8SRJl17jcrMzEZtpfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)