UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XghMSzULo13jztz+hb5Mg2Nl+VuK+VIHak/StSpbBN8='
WHERE
key_id = '1e2e0578138480f2732e5b8adf7a89e005b13ae3efeb2c6abf0acb71aacd30f7'
AND (
token = 'XghMSzULo13jztz+hb5Mg2Nl+VuK+VIHak/StSpbBN8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)