UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iAhwgJFz6YwRj3SpYM57AEXPygaJXlcHOBgfDeoHNms='
WHERE
key_id = 'c9e695e639f101dc89e1fe0474ed62eef4fff3c8cb9dbb960f462699ee15b650'
AND (
token = 'iAhwgJFz6YwRj3SpYM57AEXPygaJXlcHOBgfDeoHNms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)