UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E+7JkXCO1h2QWmWoDS5U9gJXqMSNPvRJAHAyi5OPKEA='
WHERE
key_id = '108b4434850bc769f0d606031fea645fa46ea1fcc9d943bb297a4b48099eb88f'
AND (
token = 'E+7JkXCO1h2QWmWoDS5U9gJXqMSNPvRJAHAyi5OPKEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)