UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DEOKQ5zUp4Vxwk0cP8hTdrkY73xlgouU0Jx+bgtTmac='
WHERE
key_id = '2fddd1bf8f4dc970bbfab48631e5cc9c040a5ea0fc43bc302d7df6e80b770daf'
AND (
token = 'DEOKQ5zUp4Vxwk0cP8hTdrkY73xlgouU0Jx+bgtTmac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)