UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OAYr/NDRdUxnbRAuoWXHi3i4moCUVzkLI4/xMAZh8n8='
WHERE
key_id = 'dfd92c11986558a94884f932850d1c35b2f330d7c4e1efc4a3bd0e8481e528bf'
AND (
token = 'OAYr/NDRdUxnbRAuoWXHi3i4moCUVzkLI4/xMAZh8n8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)