UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vw/uqVJMKOGkR6mOSuC0L9vciHpkVNeGYnuOdWkHi5k='
WHERE
key_id = 'ed772c361ddc1721742169fb58c2876191041a5908ab6680fcc904f3e7c1ee30'
AND (
token = 'vw/uqVJMKOGkR6mOSuC0L9vciHpkVNeGYnuOdWkHi5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)