UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VGfo+qqr701qXPr5eHHunMWcE7ZAR/fnLSfoQiJB6Vg='
WHERE
key_id = 'bb22150f5977c9d8f489155297a2881adc3c12f6e06ec1ac157d93083efc68da'
AND (
token = 'VGfo+qqr701qXPr5eHHunMWcE7ZAR/fnLSfoQiJB6Vg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)