UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gxZ9yWW26VW7cWLsiVw3XPJinZKF53whv4EPdGBKaOk='
WHERE
key_id = '50ea7507f1afe66690f79c6d2be2deb94bbe108d11213e6d8dfe86e029b6ba72'
AND (
token = 'gxZ9yWW26VW7cWLsiVw3XPJinZKF53whv4EPdGBKaOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)