UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n9LvicJ4zYaDA/OE4sJOz23QfJ7cCIaL/JAtp4xLOyc='
WHERE
key_id = '121f01c13faab1052425724330caa0318cad1c49cf373ac7e54501be5d7c408b'
AND (
token = 'n9LvicJ4zYaDA/OE4sJOz23QfJ7cCIaL/JAtp4xLOyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)