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